package com.financing.platform.service.impl;

import java.sql.SQLException;
import java.util.List;

import org.apache.xalan.transformer.MsgMgr;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.financing.platform.dao.IJpushMessageDao;
import com.financing.platform.dto.MessageJpushDTO;
import com.financing.platform.service.IJPushMessageService;
import com.financing.platform.util.Dict;


/**
 * 极光推送消息管理
 * @author qiye
 *
 */
@Service("jPushMessageService")
public class JPushMessageServiceImpl extends BaseServiceImpl implements IJPushMessageService {
	
	@Autowired
	private IJpushMessageDao jpushMessageDao;

	@Override
	public List<MessageJpushDTO> queryJpushMessageList(MessageJpushDTO dto) throws SQLException {
		return jpushMessageDao.queryJpushMessageList(dto);
	}

	@Override
	public int updateJpushMessage(MessageJpushDTO dto) throws SQLException {
		return jpushMessageDao.updateJpushMessage(dto);
	}

	@Override
	public int addJpushMessage(MessageJpushDTO dto) throws SQLException {
		dto.setFpJpushMsgType(Dict.jPushMessageType_operate);
		dto.setFpJpushSendStatus(Dict.message_status_not_send);
		dto.setFpJpushSendTimes(new Integer(0));
		return jpushMessageDao.addJpushMessage(dto);
	}

	@Override
	public int queryMessageJpushCount(MessageJpushDTO dto) throws SQLException {
		return  jpushMessageDao.queryMessageJpushCount(dto);
	}

}

	